package org.grow.basic.service;

import org.springframework.stereotype.Service;

import java.util.Random;

/**
 * @Author: xwg
 * @CreateDate: 2022/5/19
 */

@Service
public class CodeGenerator {
    private Random random = new Random();
    public String nextCode(String prefix){
        StringBuffer sb = new StringBuffer();
        sb.append(prefix);
        long l = System.currentTimeMillis();
        sb.append(l);
        int i = random.nextInt(10);
        sb.append(i);
        return sb.toString();
    }
}
